<?php
header('Content-Type:text/html;charset=utf-8');
@header("Access-Control-Allow-Origin:*");
header('Access-Control-Allow-Origin:http://127.0.0.1:5500');
$servername="localhost:3306";
$username=$password="root";
$dbname="1907";
$conn=mysqli_connect($servername,$username,$password,$dbname);

$id=$_GET['id'];

$sql="delete from userinfo where id='$id'";

$result=mysqli_query($conn,$sql);

$cont=mysqli_affected_rows($conn);

$obj=array();

if($cont>0){
    $obj['code']=1;
    $obj['msg']='用户删除成功';
}

echo json_encode($obj)


?>